/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-07-11 11:18:06
 * @LastEditors: wiz
 * @LastEditTime: 2023-12-29 13:30:00
 */
import Vue from 'vue';

import { N_oSetupPanel } from '@/types';
import { I_editor, T_editor } from './editor';

namespace N_oBaseGrid {
  /*
  props
   // 编辑锁 默认开启
  isUseEditLock: boolean;
   // 已调入编辑锁资料
  private isLoadEditLock: boolean = false;
  event
  //加载数据条数
  @load-data-info  => I_loadDataInfo
  //是否要组件协调
  isCoordination:boolean = true
  
*/
  // column 操作列 配置
  export interface I_operateColumnConfig {
    display: Set<string>;
    usable: Set<string>;
  }

  // bus事件替换
  export interface I_regCustEventName {
    receive?: {
      // 原事件名
      source: string;
      // 目的名
      target: string;
    };
    send?: {
      // 原事件名
      source: string;
      // 目的名
      target: string;
    };
  }
  // 加载数据信息
  export interface I_loadDataInfo {
    funName: string;
    total: number;
  }

  export interface I_fieldFilter {
    fieldName: string;
    stdFieldName: string; // slc|... m2o|... `table`.`fieldName`
    isI18n: boolean;
    isSlc: boolean;
    isM2o: boolean;
    isSubQry: boolean;
    pattern: Array<string>;
  }

  export interface I_oBaseGridTcmd extends T_editor {}

  export interface oBaseGrid extends Vue {
    editStatus: boolean;
    // 是否组件协调
    isCoordination: boolean;
    isMask: boolean; // 遮罩
    GT_editor: I_editor;
    grid: any;
    toolbar: any;
    isIndependent: boolean;
    // 编辑锁 默认开启
    isUseEditLock: boolean;
    // 已调入编辑锁资料
    isLoadEditLock: boolean;
    cleanSubCompData: (
      p: N_oSetupPanel.N_comps.T_eventCoordinationToolbar
    ) => void;
  }
}
export { N_oBaseGrid };
